#ifndef PROGRAM_DATASTRUCT_DOUBLELIST_H_
#define PROGRAM_DATASTRUCT_DOUBLELIST_H_

namespace doublelist{

class ListElmt
{
public:
    ListElmt(int data);
public:
    void SetData(int d);
    void SetPre(ListElmt* p);
    void SetNext(ListElmt* n);

    int GetData();
    ListElmt* GetPre();
    ListElmt* GetNext();
private:
    int m_data;
    ListElmt* m_pre;
    ListElmt* m_next;
};

class DoubleList
{
public:
    DoubleList();
    ~DoubleList();
public:
    ListElmt* ListHead();
    ListElmt* ListTail();
    int GetListSize();

    ListElmt* ListDel(ListElmt* e);
    void ListInsert(ListElmt* e);
    void ListInsert(ListElmt* e, ListElmt* i);
private:
    ListElmt* m_head;
    ListElmt* m_tail;
    int m_size;
};

void PrintDoubleList(DoubleList* l);
}

#endif // PROGRAM_DATASTRUCT_DOUBLELIST_H_
